{% extends "BackendBundle::backend.html.twig" %}

{% block title %}{{ "Administracion Servicios"|trans }}{% endblock %}

{% set vars = {'ruta' : app.request.attributes.get('_route')} %}

{% if modi == 1 %}

    {% set Nombre = servicio.nombreservicio %}

{% elseif modi == 0 or modi == 2 %}

    {% set Nombre = "" %}

{% endif %}

{% block header %}

    {% include "BackendBundle::topmenu.html.twig" with vars %}

{% endblock %}

{% block left %}

    {% include "ServiciosBundle:Default:menuleft.html.twig" with vars %}

{% endblock %}

{% block content %}

    <div class="span9">
        
        <h2>{{"Servicios"|trans}}</h2>
        {% if modi == 2 %}
        <form action="{{ path('ServiciosBundle_tradu_save') }}" class="form-horizontal" name="formserveis" id="formserveis" method="post">
        {% elseif modi == 1 %}
        <form action="{{ path('ServiciosBundle_editar_save') }}" class="form-horizontal" name="formserveis" id="formserveis" method="post">
        {% elseif modi == 0 %}
        <form action="{{ path('ServiciosBundle_formulario_alta_save') }}" class="form-horizontal" name="formserveis" id="formserveis" method="post">
        {% endif %}

            <fieldset>
                {% if modi == 2 %}
                <legend>{{"Traducción Servicio"|trans}}</legend>    
                {% elseif modi == 1 %}
                <legend>{{"Edit Servicio"|trans}}</legend>
                {% elseif modi == 0 %}
                <legend>{{"Añadir Servicio"|trans}}</legend>
                {% endif %}
                
                {% if app.session.hasFlash('success') %}
                    <div class="flash-notice alert alert-success">
                        <h4 class="alert-heading">{{ "Ok"|trans }}!</h4>                     
                        {{ app.session.flash('success') }}
                    </div>
                {% endif %}

                {% if app.session.hasFlash('error') %}
                    <div class="flash-notice alert alert-error">
                        <h4 class="alert-heading">{{ "Error"|trans }}!</h4>                        
                        {{ app.session.flash('error') }}
                    </div>
                {% endif %}

                {% if app.session.hasFlash('info') %}
                    <div class="flash-notice alert alert-info">
                        <h4 class="alert-heading">{{ "Info"|trans }}!</h4>
                        <p>{{ app.session.flash('info') }}</p>
                    </div>
                {% endif %}

                <div class="control-group">

                    <label class="control-label" for="nombreservicio">{{"Nombre del Servicio"|trans}} *</label>

                    <div class="controls">
                        <input class="input-xlarge" name="nombreservicio" id="nombreservicio" value="{{ Nombre }}" type="text" />
                    </div>

                </div>
                
                <div class="form-actions">
                    <input class="btn btn-primary" name="ServeisGuarda" value="{{ "Guardar"|trans }}" type="submit">
                    {% if modi == 1 or modi == 2 %}
                    <a href="{{ path('ServiciosBundle_homepage_idioma', {'ididioma': ididioma}) }}" class="btn">{{ "Cancelar"|trans }}</a>
                    {% elseif modi == 0 %}
                    <a href="{{ path('ServiciosBundle_homepage') }}" class="btn">{{ "Cancelar"|trans }}</a>
                    {% endif %}
                </div>                

            </fieldset>
                    
        </form>
        
    </div>

{% endblock %}
